package com.rp.system.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.rp.common.utils.RpUtil;
import com.rp.system.dao.HomePanelDao;
import com.rp.system.po.HomePanel;

@Service
@Transactional
public class PanelService {

	@Autowired
	private HomePanelDao hpDao;
	
	
	public String addPanel(HomePanel panel){
		panel.setCreateDate(RpUtil.getCurrentDatetime());
		return (String) hpDao.save(panel);
	}
	
	public void updatePanel(HomePanel panel){
		panel.setUpdateDate(RpUtil.getCurrentDatetime());
		hpDao.update(panel);
	}
	
	public void deletePanel(String panelId){
		hpDao.delete(panelId);
	}
	
	public HomePanelDao getHpDao() {
		return hpDao;
	}
	
}
